home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / SciAn / src / ScianIcons.c < prev    next >
C/C++ Source or Header  |  1994-08-01  |  15KB  |  686 lines

  1. /*ScianIcons.c
  2.   Eric Pepke
  3.   March 22, 1990
  4.   Does icon stuff in scian
  5.  
  6.   Added PostScript output to DrawIcon, 8/25/92, JEL
  7. */
  8.  
  9. #include "Scian.h"
  10. #include "ScianTypes.h"
  11. #include "ScianIcons.h"
  12. #include "ScianColors.h"
  13. #include "ScianArrays.h"
  14. #include "ScianErrors.h"
  15. #include "ScianLists.h"
  16. #include "ScianIDs.h"
  17. #include "ScianEvents.h"
  18. #include "ScianControls.h"
  19. #include "ScianScripts.h"
  20. #include "ScianStyle.h"
  21. #include "ScianDraw.h"
  22. #include "ScianTextBoxes.h"
  23. #include "ScianFontSystem.h"
  24. #ifdef GRAPHICS
  25. #include "ScianIconFonts.h"
  26. #endif
  27.  
  28.  
  29. ObjPtr iconClass = 0;
  30. int iconXOff, iconYOff;        /*Offsets for icons on dragging*/
  31.  
  32. #define COLORICONXOFFSET    -5    /*X offset for color icon*/
  33. #define COLORICONYOFFSET    0    /*Y offset for color icon*/
  34.  
  35. #define NRAINBOWCOLORS    5
  36.  
  37. int rainbowColor[NRAINBOWCOLORS] =
  38.     {
  39.     UIRED,
  40.     UIYELLOW,
  41.     UIGREEN,
  42.     UICYAN,
  43.     UIBLUE
  44.     };
  45.  
  46.  
  47. static ObjPtr ColorIconExtraDraw(object, x, y)
  48. ObjPtr object;
  49. int x, y;
  50. /*Draws extra stuff for a color icon*/
  51. {
  52. #ifdef GRAPHICS
  53.     short bx, by, ex, ey, k;
  54.  
  55.     bx = x + COLORICONXOFFSET;
  56.     by = y + COLORICONYOFFSET;
  57.     ex = x + ICONSIZE / 2;
  58.     ey = by - (ex - bx) / 2;
  59.     for (k = 0; k < NRAINBOWCOLORS; ++k)
  60.     {
  61.     SetUIColor(rainbowColor[k]);
  62.     FillTri(bx, by, ex, ey, ex, ey + (ex - bx) / (NRAINBOWCOLORS - 1));
  63.     ey += (ex - bx) / (NRAINBOWCOLORS - 1);
  64.     }
  65. #endif
  66. }
  67.  
  68. #ifdef PROTO
  69. void DrawIcon(int x, int y, int whichIcon, char *iconTitle, char *subTitle, int backColor, int flags)
  70. #else
  71. void DrawIcon(x, y, whichIcon, iconTitle, subTitle, backColor, flags)
  72. int x, y, whichIcon;
  73. char *iconTitle;
  74. char *subTitle;
  75. int backColor;
  76. int flags;
  77. #endif
  78. /*Draw icon whichIcon with its center at x, y with title
  79.   iconTitle.  If iconTitle is NIL, doesn't draw a title.  
  80.   Draws the background of the color in UIcolor backColor.
  81.   Flags tells what parts to draw.
  82. */
  83. {
  84. #ifdef GRAPHICS
  85.     Icoord v[4][2];
  86.     char s[2];
  87.     int texty;
  88.     int k;
  89.     int iconFont, iconChar, iconIndex;
  90.     int fontSize;
  91.  
  92.     s[1] = '\0';
  93.  
  94.     /*Get the icon font and character*/
  95.     iconFont = iconFontLocationTable[whichIcon - 32][0];
  96.     iconChar = iconFontLocationTable[whichIcon - 32][1];
  97.  
  98.     if (drawingMode == DRAW_SCREEN)
  99.     {
  100.     font(ICONBEGFONTS + iconFont);
  101.     }
  102.     else if (drawingMode == DRAW_POSTSCRIPT && psFile)
  103.     {
  104.     RegisterFontUsed("icons");
  105.     if ((iconIndex = RegisterIconUsed(whichIcon)) < 0) return;
  106.     if (strcmp("icons", curFontName) != 0)
  107.     {
  108.         fprintf(psFile,"/icons findfont 32 scalefont setfont\n");
  109.         strcpy(curFontName, "icons"); /* remember this */
  110.         curFontSize = 32;
  111.     }
  112.     }
  113.  
  114.     if (flags & DI_DRAWSHADOW)
  115.     {
  116.     SetUIColor(UISHADOW);
  117.     if (drawingMode == DRAW_SCREEN)
  118.     {
  119.         cmov2i(x - ICONSIZE / 2, y - ICONSIZE / 2 - ICONSHADOW);
  120.         s[0] = iconChar + 2;
  121.         charstr(s);
  122.     }
  123.     else if (drawingMode == DRAW_POSTSCRIPT && psFile)
  124.     {
  125.         fprintf(psFile, "%f setgray\n", PSColor());
  126.         s[0] = 32 + 3*iconIndex + 2;
  127.         fprintf(psFile,"%d %d moveto (%s) show\n",
  128.         x - ICONSIZE/2, y - ICONSIZE/2 - ICONSHADOW, show(s));
  129.     }
  130.     }
  131.  
  132.     for (k = 0; k >= 0; --k)
  133.     {
  134.     if (flags & DI_DRAWBACK)
  135.     {
  136.         SetUIColor(k ? UIICONGREYBACK : backColor);
  137.         if (drawingMode == DRAW_SCREEN)
  138.         {
  139.         cmov2i(x - ICONSIZE / 2 + k * 2, y - ICONSIZE / 2 + k * 2);
  140.         s[0] = iconChar + 1;
  141.         charstr(s);
  142.         }
  143.             else if (drawingMode == DRAW_POSTSCRIPT && psFile)
  144.             {
  145.         fprintf(psFile, "%f setgray\n", PSColor());
  146.         s[0] = 32 + 3*iconIndex + 1;
  147.                 fprintf(psFile,"%d %d moveto (%s) show\n",
  148.                     x - ICONSIZE/2 + k*2, y - ICONSIZE/2 + k*2, show(s));
  149.             }
  150.     }
  151.  
  152.     if (flags & DI_DRAWFORE)
  153.     {
  154.         if (flags & DI_GREY || k)
  155.         {
  156.         SetUIColor(UIICONGREYFORE);
  157.         }
  158.         else
  159.         {
  160.         SetUIColor(UIICONFORE);
  161.         }
  162.         if (drawingMode == DRAW_SCREEN)
  163.         {
  164.         cmov2i(x - ICONSIZE / 2 + k * 2, y - ICONSIZE / 2 + k * 2);
  165.         s[0] = iconChar;
  166.         charstr(s);
  167.         }
  168.             else if (drawingMode == DRAW_POSTSCRIPT && psFile)
  169.             {
  170.         fprintf(psFile, "%f setgray\n", PSColor());
  171.         s[0] = 32 + 3*iconIndex;
  172.                 fprintf(psFile,"%d %d moveto (%s) show\n",
  173.                     x - ICONSIZE/2 + k*2, y - ICONSIZE/2 + k*2, show(s));
  174.             }
  175.      }
  176.     }
  177.  
  178.     texty = y - ICONSIZE / 2 - (flags & DI_DRAWSHADOW ? ICONSHADOW : 0) - ICONTEXTOFFSET;
  179.     if (iconTitle)
  180.     {
  181.     char *s, *s2;
  182.  
  183.     SetUIColor(UITEXT);
  184.     fontSize = flags & DI_SMALLTEXT ? ICONTEXTSMALLSIZE : ICONTEXTSIZE;
  185.     SetUIFont(flags & DI_SMALLTEXT ? ICONSUBTITLEFONT : ICONNAMEFONT);
  186.  
  187.     s = iconTitle;
  188.     s2 = tempStr;
  189.  
  190.     while (*s)
  191.     {
  192.         if (*s == '\n')
  193.         {
  194.         *s2 = 0;
  195.         ++s;
  196.         s2 = tempStr;
  197.         DrawAString(CENTERALIGN, x, 
  198.            texty,
  199.            tempStr);
  200.         texty -= (fontSize);
  201.         }
  202.         else
  203.         {
  204.         *s2 = *s;
  205.         ++s;
  206.         ++s2;
  207.         }
  208.     }
  209.     *s2 = 0;
  210.     DrawAString(CENTERALIGN, x, 
  211.            texty,
  212.            tempStr);
  213.  
  214.     if (subTitle)
  215.     {
  216.     texty -= (fontSize + 2);
  217.     SetUIColor(UITEXT);
  218.     SetUIFont(ICONSUBTITLEFONT);
  219.     DrawAString(CENTERALIGN, x, 
  220.                texty,
  221.            subTitle);
  222.     }
  223.     }   
  224. #endif
  225. }
  226.  
  227. #ifdef PROTO
  228. void GenIconDef(FILE *outFile)
  229. #else
  230. void GenIconDef(outFile)
  231. FILE *outFile;
  232. #endif
  233. /* output PostScript font definition for icons used in eps file */
  234. {
  235. #ifdef GRAPHICS
  236.     int icon, c, i, j, k;
  237.  
  238.     if (!outFile || numIconsUsed < 1) return;
  239.     
  240.     /* generate font def header and Encoding array */
  241.     fprintf(outFile, 
  242. "%%%%BeginFont: icons\n\
  243. /iconfont 10 dict def\n\
  244. iconfont begin\n\
  245.     /FontType 3 def\n\
  246.     /FontMatrix [1 0 0 1 0 0] def\n\
  247.     /FontBBox [0 0 32 32] def\n\
  248.     /Encoding 256 array def\n\
  249.     0 1 255 { Encoding exch /.notdef put } for\n\n");
  250.  
  251.     for (i=0, c=32; i<numIconsUsed; ++i)
  252.     {
  253.     fprintf(outFile, "\tEncoding %d /fore%02d put\n", c++, i);
  254.     fprintf(outFile, "\tEncoding %d /back%02d put\n", c++, i);
  255.     fprintf(outFile, "\tEncoding %d /shad%02d put\n", c++, i);
  256.     }
  257.     fprintf(outFile, 
  258. "\n\
  259.     /CharProcs %d dict def\n\
  260.     CharProcs begin\n\
  261.         /.notdef { } def        %%not defined\n\n",
  262.         3*numIconsUsed + 1);
  263.         
  264.     /* generate the CharProcs */
  265.     for (i=0; i<numIconsUsed; ++i)
  266.     {
  267.     register unsigned short *p;
  268.     int iconFont, iconChar;
  269.     
  270.     iconFont = iconFontLocationTable[iconsUsed[i] - 32][0];
  271.     iconChar = iconFontLocationTable[iconsUsed[i] - 32][1];
  272.     fprintf(outFile, "%%font %d, char %d\n", iconFont, iconChar);
  273.  
  274.     /* set up pointer = (rasters for this font) + (offset to this character) */
  275.     p = (unsigned short *) iconFontParameters[iconFont].rasters + 64*(iconChar - 32);
  276.  
  277.     fprintf(outFile, "\t\t/fore%02d\n\t\t{<\n\t\t", i);
  278.     for (k=0; k<4; ++k)
  279.     {
  280.       for (j=0; j<16; ++j)
  281.         fprintf(outFile,"%04X",*p++);
  282.       fprintf(outFile,"\n\t\t");
  283.     }
  284.     fprintf(outFile, ">} def\n");
  285.     
  286.     fprintf(outFile, "\t\t/back%02d\n\t\t{<\n\t\t", i);
  287.     for (k=0; k<4; ++k)
  288.     {
  289.       for (j=0; j<16; ++j)
  290.         fprintf(outFile,"%04X",*p++);
  291.       fprintf(outFile,"\n\t\t");
  292.     }
  293.     fprintf(outFile, ">} def\n");
  294.     
  295.     fprintf(outFile, "\t\t/shad%02d\n\t\t{<\n\t\t", i);
  296.     for (k=0; k<4; ++k)
  297.     {
  298.       for (j=0; j<16; ++j)
  299.         fprintf(outFile,"%04X",*p++);
  300.       fprintf(outFile,"\n\t\t");
  301.     }
  302.     fprintf(outFile, ">} def\n\n");
  303.     }
  304.  
  305.     /* generate font def trailer */
  306.     fprintf(outFile, 
  307. "    end %%CharProcs\n\
  308. \n\
  309.     /BuildChar\n\
  310.     {\n\
  311.         32 0 0 0 32 32 setcachedevice\n\
  312.         exch begin        %%icon font dict\n\
  313.         Encoding exch get    %%get icon index\n\
  314.         CharProcs exch get    %%get icon name\n\
  315.         end\n\
  316.         32 32\n\
  317.         true\n\
  318.         [32 0 0 32 0 0]\n\
  319.         5 -1 roll               %%get name back on top\n\
  320.         exec            %%get bits\n\
  321.         imagemask        %%draw it\n\
  322.     } def\n\
  323. \n\
  324. end %%iconfont\n\
  325. \n\
  326. /icons iconfont definefont pop\n\
  327. %%%%EndFont\n\n");
  328.  
  329. #endif
  330.     return;    
  331. }
  332.  
  333. #ifdef PROTO
  334. void DrawIconGhost(ObjPtr icon, int xDisp, int yDisp)
  335. #else
  336. void DrawIconGhost(icon, xDisp, yDisp)
  337. ObjPtr icon;
  338. int xDisp, yDisp;
  339. #endif
  340. /*Draw a ghost of icon icon, displacint its center by xDisp, yDisp.*/
  341. {
  342. #ifdef GRAPHICS
  343.     Icoord v[4][2];
  344.     char s[2];
  345.     ObjPtr theName, whichIconInt, theLoc;
  346.     int x, y;
  347.     real loc[2];
  348.     int whichIcon;
  349.     char *name;
  350.     int iconFont, iconChar;
  351.  
  352.     theName = GetVar(icon, NAME);
  353.     if (IsString(theName))
  354.     {
  355.     name = GetString(theName);
  356.     }
  357.     else
  358.     {
  359.     name = 0;
  360.     }
  361.     whichIconInt = GetVar(icon, WHICHICON);
  362.     if (whichIconInt && IsInt(whichIconInt))
  363.     {
  364.     whichIcon = GetInt(whichIconInt);
  365.     }
  366.     else
  367.     {
  368.     return;
  369.     }
  370.     theLoc = GetFixedArrayVar("DrawIconGhost", icon, ICONLOC, 1, 2L);
  371.     if (!theLoc)
  372.     {
  373.     return;
  374.     }
  375.     Array2CArray(loc, theLoc);
  376.     x = loc[0] + xDisp;
  377.     y = loc[1] + yDisp;
  378.  
  379.     iconFont = iconFontLocationTable[whichIcon - 32][0];
  380.     iconChar = iconFontLocationTable[whichIcon - 32][1];
  381.     font(ICONBEGFONTS + iconFont);
  382.  
  383.     s[1] = 0;
  384.     s[0] = iconChar;
  385.  
  386.     cmov2i(x - ICONSIZE / 2, y - ICONSIZE / 2);
  387.     charstr(s); 
  388.  
  389.     if (name)
  390.     {
  391.     SetUIFont(ICONNAMEFONT);
  392.     DrawAString(CENTERALIGN, x, 
  393.            y - ICONSIZE / 2 - ICONSHADOW - ICONTEXTOFFSET,
  394.            name);
  395.     }
  396. #endif
  397. }
  398.  
  399. ObjPtr IconBoundsInvalid(icon, changeCount)
  400. ObjPtr icon;
  401. unsigned long changeCount;
  402. /*Returns invalid bounds of icon*/
  403. {
  404.     ObjPtr var;
  405.  
  406.     MakeVar(icon, APPEARANCE);
  407.  
  408.     if (GetVarChangeCount(icon, CHANGEDBOUNDS) > changeCount)
  409.     {
  410.     real loc[2], bounds[4];
  411.  
  412.  
  413.     var = GetVar(icon, ICONLOC);
  414.     if (!var)
  415.     {
  416.         return ObjTrue;
  417.     }
  418.     Array2CArray(loc, var);
  419.  
  420.     bounds[0] = loc[0] - ICONSIZE / 2 - 1 - ICONINVALEXTRA;
  421.     bounds[1] = loc[0] + ICONSIZE / 2 + 1;
  422.     bounds[2] = loc[1] - ICONSIZE / 2 - 1;
  423.     bounds[3] = loc[1] + ICONSIZE / 2 + 1 + ICONINVALEXTRA;
  424.  
  425.     MakeVar(icon, NAME);
  426.     if (GetVarChangeCount(icon, NAME) > changeCount)
  427.     {
  428.         ObjPtr name, oldName;
  429.         int w1, w2, w;
  430.  
  431.         SetUIFont(ICONNAMEFONT);
  432.  
  433.         name = GetVar(icon, NAME);
  434.         if (name)
  435.         {
  436.         w1 = StrWidth(GetString(name));
  437.         }
  438.         else
  439.         {
  440.         w1 = 0;
  441.         }
  442.  
  443.         name = GetVar(icon, OLDNAME);
  444.         if (name)
  445.         {
  446.         w2 = StrWidth(GetString(name));
  447.         }
  448.         else
  449.         {
  450.         w2 = 0;
  451.         }
  452.  
  453.         w = MAX(w1, w2);
  454.         if (w > 0)
  455.         {
  456.         int m;
  457.         m = ((int) (bounds[0] + bounds[1])) / 2;
  458.         bounds[2] -= ICONSHADOW + ICONTEXTOFFSET + 6;
  459.         bounds[0] = MIN(bounds[0], m - 2 - w/2);
  460.         bounds[1] = MAX(bounds[1], m + 2 + w/2);
  461.         }
  462.     }
  463.  
  464.     var = NewRealArray(1, 4L);
  465.     CArray2Array(var, bounds);
  466.     return var;
  467.     }
  468.     else
  469.     {
  470.     return NULLOBJ;
  471.     }
  472. }
  473.  
  474. ObjPtr DrawIconObj(object)
  475. ObjPtr object;
  476. /*Draws this icon thing*/
  477. {
  478. #ifdef GRAPHICS
  479.     ObjPtr theLoc;
  480.     ObjPtr theName;
  481.     char *title, *subTitle;
  482.     ObjPtr whichIconInt;
  483.     real loc[2];
  484.     int whichIcon;
  485.     FuncTyp method;
  486.     ObjPtr repObj;
  487.     Bool isGreyed;
  488.     int backColor;
  489.     ObjPtr var;
  490.  
  491.     theLoc = GetFixedArrayVar("DrawIconObj", object, ICONLOC, 1, 2L);
  492.     if (!theLoc)
  493.     {
  494.     return NULLOBJ;
  495.     }
  496.  
  497.     MakeVar(object, NAME);
  498.     theName = GetVar(object, NAME);
  499.     if (theName && IsString(theName))
  500.     {
  501.     title = GetString(theName);
  502.     }
  503.     else
  504.     {
  505.     title = (char *) 0;
  506.     }
  507.  
  508.     MakeVar(object, FORMAT);
  509.     theName = GetVar(object, FORMAT);
  510.     if (theName && IsString(theName))
  511.     {
  512.     subTitle = GetString(theName);
  513.     }
  514.     else
  515.     {
  516.     subTitle = (char *) 0;
  517.     }
  518.  
  519.     whichIconInt = GetVar(object, WHICHICON);
  520.     if (whichIconInt && IsInt(whichIconInt))
  521.     {
  522.     whichIcon = GetInt(whichIconInt);
  523.     }
  524.     else
  525.     {
  526.     whichIcon = ICONQUESTION;
  527.     }
  528.  
  529.     Array2CArray(loc, theLoc);
  530.  
  531.     MakeVar(object, ICONGREYED);
  532.     isGreyed = GetPredicate(object, ICONGREYED);
  533.  
  534.     var = GetVar(object, BACKGROUND);
  535.     if (var)
  536.     {
  537.     backColor = GetInt(var);
  538.     }
  539.     else
  540.     {
  541.     backColor = UIICONBACK;
  542.     }
  543.  
  544.     repObj = GetVar(object, REPOBJ);
  545.     DrawIcon((int) loc[0], (int) loc[1], whichIcon, 
  546.         title, subTitle, 
  547.         IsSelected(repObj ? repObj : object) ? UIICONSELBACK : 
  548.             (isGreyed ? UIICONGREYBACK : backColor),
  549.         isGreyed ?
  550.             DI_DRAWFORE | DI_DRAWBACK | DI_DRAWSHADOW | DI_GREY :
  551.             DI_DRAWFORE | DI_DRAWBACK | DI_DRAWSHADOW);
  552.  
  553.     method = GetMethod(object, ICONEXTRADRAW);
  554.     if (method)
  555.     {
  556.     (*method)(object, (int) loc[0], (int) loc[1]);
  557.     }
  558. #endif
  559.     return ObjTrue;
  560. }
  561.  
  562. ObjPtr NewIcon(x, y, whichIcon, name)
  563. int x, y;
  564. int whichIcon;
  565. char *name;
  566. /*Makes and returns a new icon of type whichIcon and name name*/
  567. {
  568.     ObjPtr retVal;
  569.  
  570.     retVal = NewObject(iconClass, 0);
  571.     if (whichIcon == ICONCOLOR)
  572.     {
  573.     SetMethod(retVal, ICONEXTRADRAW, ColorIconExtraDraw);
  574.     }
  575.     if (retVal)
  576.     {
  577.     real loc[2];
  578.     ObjPtr locArray;
  579.     
  580.     loc[0] = x;
  581.     loc[1] = y;
  582.     locArray = NewRealArray(1, (long) 2);
  583.     if (locArray)
  584.     {
  585.         CArray2Array(locArray, loc);
  586.         SetVar(retVal, ICONLOC, locArray);
  587.     }
  588.  
  589.     SetVar(retVal, WHICHICON, NewInt(whichIcon));
  590.  
  591.     if (name)
  592.     {
  593.         SetVar(retVal, NAME, NewString(name));
  594.     }
  595.     }
  596.  
  597.     return retVal;
  598. }
  599.  
  600. ObjPtr MakeIconGreyed(icon)
  601. ObjPtr icon;
  602. /*Makes an icon greyed or not*/
  603. {
  604.     ObjPtr repObj;
  605.     repObj = GetVar(icon, REPOBJ);
  606.     if (repObj)
  607.     {
  608.     SetVar(icon, ICONGREYED, GetVar(repObj, HIDDEN));
  609.     }
  610.     else
  611.     {
  612.     SetVar(icon, ICONGREYED, ObjFalse);
  613.     }
  614. }
  615.  
  616. static ObjPtr MakeIconAppearance(icon)
  617. ObjPtr icon;
  618. /*Dummy make for icon appearance*/
  619. {
  620.     SetVar(icon, APPEARANCE, ObjTrue);
  621.     ImInvalid(icon);
  622.     return ObjTrue;
  623. }
  624.  
  625. static ObjPtr MakeIconName(icon)
  626. ObjPtr icon;
  627. /*Makes an icon's name from its REPOBJ*/
  628. {
  629.     ObjPtr repObj;
  630.  
  631.     MakeVar(icon, REPOBJ);
  632.     repObj = GetVar(icon, REPOBJ);
  633.     if (repObj)
  634.     {
  635.     SetVar(icon, OLDNAME, GetVar(icon, NAME));
  636.     SetVar(icon, NAME, GetVar(repObj, NAME));
  637.     ImInvalid(icon);
  638.     }
  639.     else
  640.     {
  641.     SetVar(icon, NAME, GetVar(icon, NAME));
  642.     }
  643.     return ObjTrue;
  644. }
  645.  
  646. void InitIcons()
  647. /*Initializes the icon system*/
  648. {
  649.     int i;
  650. #ifdef GRAPHICS
  651.     for (i = 0; i < NICONFONTS; ++i)
  652.     {
  653.     defrasterfont(ICONBEGFONTS + i,
  654.         iconFontParameters[i] . ht,
  655.         iconFontParameters[i] . nc,
  656.         iconFontParameters[i] . chars,
  657.         iconFontParameters[i] . rs,
  658.         (void *) iconFontParameters[i] . rasters);
  659.     /*Have to use (void *) cast to make compatible both
  660.      with SGI and IBM*/
  661.     }
  662. #endif
  663.  
  664.     iconClass = NewObject(screenClass, 0);
  665.     AddToReferenceList(iconClass);
  666.     SetVar(iconClass, CLASSID, NewInt(CLASS_ICON));
  667.     SetMethod(iconClass, DRAW, DrawIconObj);
  668.     SetVar(iconClass, TYPESTRING, NewString("icon"));
  669.     DeclareIndirectDependency(iconClass, ICONGREYED, REPOBJ, HIDDEN);
  670.     SetMethod(iconClass, ICONGREYED, MakeIconGreyed);
  671.     DeclareIndirectDependency(iconClass, APPEARANCE, REPOBJ, SELECTED);
  672.     DeclareIndirectDependency(iconClass, APPEARANCE, REPOBJ, HIDDEN);
  673.     DeclareDependency(iconClass, APPEARANCE, NAME);
  674.     DeclareIndirectDependency(iconClass, NAME, REPOBJ, NAME);
  675.     SetMethod(iconClass, APPEARANCE, MakeIconAppearance);
  676.     SetMethod(iconClass, BOUNDSINVALID, IconBoundsInvalid);
  677.     SetMethod(iconClass, NAME, MakeIconName);
  678.     SetVar(iconClass, REPOBJONLY, ObjTrue);
  679. }
  680.  
  681. void KillIcons()
  682. /*Kills the icons*/
  683. {
  684.     DeleteThing(iconClass);
  685. }
  686.